package com.sjf.config;

import com.alibaba.druid.pool.ElasticSearchDruidDataSourceFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.sql.DataSource;

@Configuration
public class DataSourceConfig {
    @Bean("esDataSource")
    public DataSource esDataSource ( EsConfig esConfig ) throws Exception {
        return ElasticSearchDruidDataSourceFactory.createDataSource (esConfig);
    }
}